
export default class tabAction {
    constructor(comp) {
        this.comp = comp;
    }

    // 切换tab的时候
    tabChange = (value) => {
        const {props} = this.comp;
        const {meta, dispatch} = props;
        dispatch({
            type: 'main/update',
            payload: {
                tabKey: value
            }
        });
        const template = meta.getMeta();
        const allTab = ['entry', 'unentry', 'manager'];
        template['appconfgrid'].items.forEach(item => {
            allTab.forEach(tab => {
                if (item.attrcode === tab + 'Head' || item.attrcode === tab + '_list_show') {
                    item.visible = tab === value;
                }
            })
        });
        meta.setMeta(template);
    }
}